﻿Imports System.Globalization
Imports System.Threading
Public Class Main

    Private Sub Test_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNRe.Click
        PanelShow.Controls.Clear()
        Dim frm As New ReservationAdd
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreservationlist.Click
        PanelShow.Controls.Clear()
        Dim frm As New ReservationView
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub
    Private Sub pvisible()
        pnReserv.Visible = True
        pcheckin.Visible = True
        pncheckout.Visible = True
        pnpayment.Visible = True
    End Sub

    Private Sub pinvisible()
        pnReserv.Visible = False
        pcheckin.Visible = False
        pncheckout.Visible = False
        pnpayment.Visible = False
    End Sub

    Private Sub Main_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
        'PanelShow.Controls.Clear()
        Login.Close()
    End Sub

    Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles pnReserv.Paint

    End Sub

    Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        pinvisible()

        'Dim ci As New CultureInfo(My.Settings.Languguage)
        'Thread.CurrentThread.CurrentCulture = ci
        'Thread.CurrentThread.CurrentUICulture = ci

        PanelShow.Controls.Clear()
        Dim frm As New BG
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub ReservationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReservationToolStripMenuItem.Click
        PanelShow.Controls.Clear()
        pinvisible()
        pnReserv.Visible = True
        ' btnNRe.Focus()
        Button2_Click(sender, e)
    End Sub

    Private Sub SetingToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetingToolStripMenuItem.Click
        FormUserSetting.ShowDialog()
    End Sub

    Private Sub CheckInToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckInToolStripMenuItem.Click
        PanelShow.Controls.Clear()
        pinvisible()
        pcheckin.Visible = True
        btnchecklist_Click(sender, e)
    End Sub

    Private Sub vtnCheckin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheckin.Click
        PanelShow.Controls.Clear()
        Dim frm As New CheckIn
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

   
    Private Sub EmployeeToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EmployeeToolStripMenuItem2.Click
        PanelShow.Controls.Clear()
        Dim frm As New EmployeeView
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub GuestToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GuestToolStripMenuItem1.Click
        PanelShow.Controls.Clear()
        Dim frm As New GuestView
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub CheckOutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckOutToolStripMenuItem.Click
        PanelShow.Controls.Clear()
        pinvisible()
        pncheckout.Visible = True
        btncheckoutlist_Click(sender, e)
    End Sub

    Private Sub btncheckout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncheckout.Click
        PanelShow.Controls.Clear()
        Dim frm As New CheckOut
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub បងលយToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles បងលយToolStripMenuItem.Click
        PanelShow.Controls.Clear()
        pinvisible()
        pnpayment.Visible = True
        btnpaymentlist_Click(sender, e)
    End Sub

    Private Sub btnpayment_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpayment.Click
        PanelShow.Controls.Clear()
        Dim frm As New Payment
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub btnpaymentlist_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpaymentlist.Click
        PanelShow.Controls.Clear()
        Dim frm As New PaymentView
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub ManageToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ManageToolStripMenuItem.Click
        Dim frm As New About
        frm.ShowDialog()
    End Sub

    Private Sub btncheckoutlist_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncheckoutlist.Click
        PanelShow.Controls.Clear()
        Dim frm As New CheckOutView
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub btnchecklist_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnchecklist.Click
        PanelShow.Controls.Clear()
        Dim frm As New CheckinView
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub LogOutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOutToolStripMenuItem.Click
        Login.Visible = True
        Me.Visible = False
    End Sub

    Private Sub ReservationListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReservationListToolStripMenuItem.Click
        pinvisible()
        PanelShow.Controls.Clear()
        Dim frm As New ReportReservationList
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub

    Private Sub CheckInListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckInListToolStripMenuItem.Click
        pinvisible()
        PanelShow.Controls.Clear()
        Dim frm As New ReportCheckInList
        frm.TopLevel = False
        frm.Visible = True
        PanelShow.Controls.Add(frm)
        frm.Show()
    End Sub
End Class